// 必须找个AppService 需要调用其他的Service
import { Injectable } from "@nestjs/common";

// 引入别的服务
import {
  UseClassLoggerService,
  UseValueLoggerService,
  UseFactoryLoggerService,
} from "./logger.service";
import { FetchData } from "./fecthData.service";

@Injectable()
export class AppService {
  constructor(
    private readonly useClassLoggerService: UseClassLoggerService,
    private readonly useValueLoggerService: UseValueLoggerService,
    private readonly useFactoryLoggerService: UseFactoryLoggerService,
    private readonly fetchData: FetchData
  ) {}

  // async main() {
  //   await this.fetchData.getData("净利润(扣除非经常性损益后)(万元)");
  // }

  getHello(): string {
    console.log(
      this.useClassLoggerService.log("useClassLoggerService hello world")
    );
    console.log(
      this.useValueLoggerService.log("useValueLoggerService hello world")
    );
    console.log(
      this.useFactoryLoggerService.log("useFactoryLoggerService hello world")
    );
    return "hello ---";
  }
}
